﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NETCORE.DI.Ope;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace NETCORE.DI.Controllers
{
    [Route("api/[controller]")]
    public class DIController : Controller
    { 
        //private IOperation _operation;

        private IServiceProvider _iServiceProvider;

        private IOperationScoped _operationScoped;


        public DIController(IOperationScoped operationScoped, IServiceProvider serviceProvider)
        {
            _operationScoped = operationScoped;

            _iServiceProvider = serviceProvider;
        }

        [Route("GetGuid")]
        public Guid GetGuid()
        {
            var res = _operationScoped.OpertaionId;

            Console.ForegroundColor = System.ConsoleColor.Red;
            Console.WriteLine(res);
            Console.ResetColor();

            return res;
        }
    }
}
